<template>
    <div class="data-menu">
        <div class="title">
            <div class="title-font">{{$t('components.data.60zdmwdxfxg0')}}</div>
            <div class="delete"><icon-more @click="toData"/></div>
        </div>
        <div class="info">
            <div class="info-top">
                <div class="info-today">
                    <div class="data">
                        <div class="data-info">
                            <p class="count">{{ form.detail?.todayNum? form.detail?.todayNum : 0 }}</p>
                            <p>{{$t('components.data.60zdmwdxkso0')}}</p>
                        </div>
                    </div>
                </div>
                <div class="info-yesterday">
                    <div class="data">
                        <div class="data-info">
                            <p class="count">{{ form.detail?.yesterDayNum? form.detail?.yesterDayNum : 0 }}</p>
                            <p>{{$t('components.data.60zdmwdxppo0')}}</p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="info-mid">
                <div class="info-title">
                    <div>{{$t('components.data.60zdmwdxqtc0')}}</div>
                    <div><icon-more @click="toData"/></div>
                </div>
                <div class="count">{{ form.detail?.sevenDayNum? form.detail?.sevenDayNum: 0 }}</div>
            </div>
        </div>
    </div>
</template>
<script lang='ts' setup>
// import { apiIndexData } from '@/api/index'
import { useRouter } from 'vue-router'
const router = useRouter()
const local = useLocal()
const form = reactive({
    active: 0,
    data: {
        page: 1,
        pageSize: 0,
        sort:'',
        uid: local.usermsg.id == 3 ? 0 : local.usermsg.id == 3 ? 0 : local.usermsg.id
    },
    loading: false,
    detail: {},
    count: 0
} as any)
// 数据
// const getData = async () => {
//     const { code, data } = await apiIndexData({
//     ...form.detail,
//   })
//   if (code != 200) return;
//   form.detail = data
// }
const toData = () => {
    router.replace('/data')
}
let timer: any
onBeforeMount(async () => {
    // await getData()
    timer = setInterval(() => {
        // getData()
    }, 1800000)
})
onBeforeUnmount(() => {
    clearInterval(timer)
    timer = null
})
</script>
<style scoped lang="less">
.data-menu {
    // width: 100%;
    // margin: 10px 20px;
    // height: 457px;
    width: 300px;

    .title {
        width: 100%;
        height: 59px;
        background-image: url('@/assets/images/index-menue-title.png');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        background-size: 100% 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-top-left-radius: 5px;
        border-top-right-radius: 5px;

        .title-font {
            margin-left: 10px;
            font-family: YouSheBiaoTiHei;
            opacity: 1;
            /** 文本1 */
            font-size: 24px;
            font-weight: 500;
            letter-spacing: 0.48px;
            line-height: 24px;
            vertical-align: middle;
            background-image: -webkit-linear-gradient(bottom,rgb(153 218 252),#ffffff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }



        .delete {
            width: 35px;
            cursor: pointer;
            font-weight: 600;
            font-size: 22px;
            color: rgba(75, 127, 239, 1);
        }
    }

    .info {
        width: 100%;
        height: 195px;
        border: 1px solid rgba(46, 116, 255, 0.8);
        background: rgba(15, 19, 41, 0.85);
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;

        .info-top {
            width: 100%;
            height: 110px;
            display: flex;
            justify-content: space-around;
            align-items: center;
            color: #fff;

            .info-today {
                width: 30%;
                height: 120px;
                background-image: url('@/assets/images/list_sjtj_bg_@2x.png');
                background-size: cover;
                background-repeat: no-repeat;
                background-position: center;

                .data {
                    width: 100%;
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;

                    .data-info {
                        text-align: center;
                        font-weight: 600;
                        font-size: 12px;
                    }

                    .count {
                        font-size: 24px;
                        font-weight: bold;
                    }
                }
            }

            .info-yesterday {
                width: 30%;
                height: 120px;
                background-image: url('@/assets/images/list_sjtj_bg_@2x.png');
                background-size: cover;
                background-repeat: no-repeat;
                background-position: center;

                .data {
                    width: 100%;
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;

                    .data-info {
                        text-align: center;
                        font-weight: 600;
                        font-size: 12px;
                    }

                    .count {
                        font-size: 24px;
                        font-weight: bold;
                    }
                }
            }
        }

        .info-mid {
            // width: 94%;
            height: 66px;
            margin: 10px;
            background-size: cover;
            background-repeat: no-repeat;
            background-position: center;
            background-image: url('@/assets/images/list_sjtj@2x.png');
            display: flex;
            flex-direction: column;
            .info-title {
                display: flex;
                justify-content: space-between;
                align-items: center;
                margin: 3px 10px 0 30px;
                color: rgba(255, 255, 255, 1);
            }

            .count {
                color: rgba(255, 255, 255, 1);
                font-weight: bold;
                font-size: 24px;
                width: 100%;
                height: 80px;
                display: flex;
                justify-content: right;
                align-items: center;
                padding-right: 15px;
            }
            :deep(.arco-btn-text) {
                font-size: 18px !important;
                font-weight: 600 !important;
                color: rgba(0, 191, 255, 1) !important;
            }
        }

        .info-bottom {
            // width: 94%;
            height: 80px;
            margin: 0 10px 20px 10px;
            background-size: cover;
            background-repeat: no-repeat;
            background-position: center;
            background-image: url('@/assets/images/list_sjtj@2x.png');
            display: flex;
            flex-direction: column;
            .info-title {
                display: flex;
                justify-content: space-between;
                align-items: center;
                height: 60px;
                margin: 0 10px 0 30px;
                color: rgba(255, 255, 255, 1);
            }

            .count {
                color: rgba(255, 255, 255, 1);
                font-weight: bold;
                font-size: 32px;
                width: 100%;
                height: 80px;
                display: flex;
                justify-content: right;
                align-items: center;
                padding-right: 40px;
            }
            :deep(.arco-icon) {
                font-size: 18px !important;
                font-weight: 600 !important;
                color: rgba(0, 191, 255, 1) !important;
            }
        }
    }
}
</style>